<?php

    $config = fopen("config.ini", "x+");
    $ip = "ip=" . $_POST["ipdb"] . "\n";
    if ($_POST["puertodb"] == "")
        $puerto = "puerto=3306\n";
    else
        $puerto = "puerto=" . $_POST["puertodb"] . "\n";
    $usuario = "user=" . $_POST["usuario"] . "\n";
    $pass = "pass=" . $_POST["pass"] . "\n";
    $db = "database=" . $_POST["bd"] . "\n";
    fwrite($config, $ip);
    fwrite($config, $puerto);
    fwrite($config, $usuario);
    fwrite($config, $pass);
    fwrite($config, $db);
    fwrite($config, $empresa);
    fclose($config);
    
    header("Location: index.php");

?>
